<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::get('tpl/{model}', function ($model) {
    return view('tpl',['model'=>$model]);
});

Route::prefix('api')->group(function () {
    Route::get('test', function () { return 'test'; });
    Route::apiResource('AirTicket', 'AirTicketController');
    Route::apiResource('AircraftModel', 'AircraftModelController');
    Route::apiResource('Airport', 'AirportController');
    Route::get('AirportTerminal/maps', 'AirportController@getMaps');
    Route::apiResource('Cabin', 'CabinController');
    Route::apiResource('City', 'CityController');
    Route::apiResource('Country', 'CountryController');
    Route::apiResource('Customer', 'CustomerController');
    Route::apiResource('Flight', 'FlightController');
    Route::get('flightMap', 'FlightController@flightMap');
    Route::apiResource('OnFlight', 'OnFlightController');
    Route::apiResource('Order', 'OrderController');
    Route::apiResource('Passenger', 'PassengerController');
    Route::apiResource('Terminal', 'TerminalController');
    Route::apiResource('TicketType', 'TicketTypeController');
    Route::apiResource('User', 'UserController');
    Route::post('login', 'UserController@login');
    Route::get('logout', 'UserController@end');
    Route::get('captcha', 'UserController@getCaptcha');
    Route::post('changePassword', 'UserController@changePassword');
    Route::post('register', 'CustomerController@register');
    Route::get('queryFlight', 'OnFlightController@query');
    Route::post('book1', 'PassengerController@book1');
    Route::put('doPay/{id}', 'OrderController@doPay');
});

